Hardcap the number of Meridian/Explorist waypoints to 500.
authorrobertl <robertl>
Thu, 17 Jan 2008 02:26:00 +0000 (02:26 +0000)
committerrobertl <robertl>
Thu, 17 Jan 2008 02:26:00 +0000 (02:26 +0000)
magproto.c

index e01f25fe709227fe6ca30dd8b5b1b550c4eb65bd..44ae86fde5a6ab65ca680818a21b977f165f3d7c 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Communicate Thales/Magellan serial protocol.
 
-    Copyright (C) 2002, 2003, 2004, 2005, 2006 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Robert Lipe, robertlipe@usa.net
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -805,6 +805,10 @@ mag_wr_init_common(const char *portname)
                bitrate=atoi(bs);
        }
 
+       if (waypt_count() > 500) {
+               fatal(MYNAME ": Meridian/Explorist does not support more than 500 waypoints in one file. Only\n200 waypoints may have comments.\nDecrease the number of waypoints sent.\n");
+       }
+
        if (cmts) {
                wptcmtcnt_max = atoi(cmts);
        } else {